﻿#ifndef GLOBALMSG_H
#define GLOBALMSG_H


#include "QTcpServer"
#include "QTcpSocket"
#include "QUdpSocket"

#include "QRandomGenerator"
#include "QDateTime"



namespace packManger{
    QByteArray buildData(QList<QByteArray> bytes); //包构建器，将多个数据包构建成一个
    QList<QByteArray> parserData(QByteArray data); //将一个组合包拆分成多个数据包
}






//结构体
struct serverMsg{
    uint32_t id = 0;  //服务器id
    QString host; //地址信息
    quint16 tcp_Port = 0; //UDP端口信息
    quint16 udp_Port = 0; //UDP端口信息
};



//代理类型
enum networkType{
    tcpNet,
    udpNet,
};



////代理信息
//struct proxyMsg{
//    networkType type = networkType::tcpNet; //网络接口类型
//    quint16 proxyProt = 0; //远程端口
//    QTcpSocket* tcpServer = nullptr; //TCP指针
//    QUdpSocket* udpSocket = nullptr; //UDP指针
//};



////当前链接信息
//namespace clientMsg{
//extern QList<serverMsg> serverList; //服务器列表信息
//extern serverMsg conServer; //当前连接的Server信息
//extern QTcpSocket* tcpCon; //TCP长连接
//extern QUdpSocket* udpCon; //UDP长连接
//extern QList<proxyMsg> proxyList; //映射代理信息表
//}




//=========================================================

////TCP区域
//void OnTcpReadyRead(); //TCP收到数据
//void OnTcpDisConnect();  //TCP断开连接


////=========================================================
//void OnUdpReadyRead();  //收到数据






#endif // GLOBALMSG_H
